home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / f_pdf.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  56 lines

  1. ;$Id: f_pdf.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1994-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5. ;+
  6. ; NAME:
  7. ;     F_PDF
  8. ;
  9. ; PURPOSE:
  10. ;       This function computes the probabilty (p) such that:
  11. ;                   Probability(X <= v) = p
  12. ;       where X is a random variable from the F distribution with 
  13. ;       (dfn) and (dfd) degrees of freedom.
  14. ;
  15. ; CATEGORY:
  16. ;    Statistics.
  17. ;
  18. ; CALLING SEQUENCE:
  19. ;       Result = f_pdf(V, DFN, DFD)
  20. ;
  21. ; INPUTS:
  22. ;       V:    A scalar of type integer, float or double that specifies
  23. ;             the cutoff value.
  24. ;
  25. ;     DFN:    A positive scalar of type integer, float or double that
  26. ;             specifies the degrees of freedom of the F distribution
  27. ;             numerator.
  28. ;
  29. ;     DFD:    A positive scalar of type integer, float or double that
  30. ;             specifies the degrees of freedom of the F distribution
  31. ;
  32. ; EXAMPLE:
  33. ;       Compute the probability that a random variable X, from the F 
  34. ;       distribution with (dfn = 5) and (dfd = 24) degrees of freedom, 
  35. ;       is less than or equal to 3.90. The result should be 0.990059 
  36. ;         result = f_pdf(3.90, 5, 24)
  37. ;
  38. ; REFERENCE:
  39. ;       APPLIED STATISTICS (third edition)
  40. ;       J. Neter, W. Wasserman, G.A. Whitmore
  41. ;       ISBN 0-205-10328-6
  42. ;
  43. ; MODIFICATION HISTORY:
  44. ;       Modified by:  GGS, RSI, July 1994
  45. ;                     Minor changes to code. New documentation header.
  46. ;-
  47.  
  48. function f_pdf, x, dfn, dfd
  49.  
  50.   on_error, 2  ;Return to caller if error occurs.
  51.  
  52.   if x le 0 then return, 1.0 else $
  53.     return, (1.0 - ibeta_pdf(dfd/(dfd+dfn*x), dfd/2.0, dfn/2.0))
  54.  
  55. end
  56.